home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiWin20d.lha / Install_AmiWin < prev    next >
Text File  |  1995-08-01  |  7KB  |  276 lines

  1. (procedure check-system-version
  2.  (set exec-version (/ (getversion) 65536))
  3.  (if (< exec-version 37)
  4.   (abort "AmiWin 2.0demo needs at least Exec version 37.\n")
  5.  )
  6. )
  7.  
  8. (procedure select-destination-directory
  9.  (set @default-dest
  10.   (askdir
  11.    (prompt "Select the directory where you want to "
  12.     "install AmiWin 2.0demo. Most of the files do not "
  13.     "have to be copied if you accept the default.")
  14.    (help "Please specify the directory where you want "
  15.     "to install AmiWin 2.0demo. If you accept the "
  16.     "default, then the installation is done 'in-place', "
  17.     "i.e. no files have to be copied. If you specify a "
  18.     "different directory, then most of the files are "
  19.     "copied there during the installation.")
  20.    (default source-dir)
  21.   )
  22.  )
  23. )  
  24.  
  25. (procedure copy-files-to-destination
  26.  (if (= source-dir
  27.   (expandpath @default-dest))
  28.   (message "\nSource and destination directories are the same, "
  29.    "installing 'in-place'.")
  30.   (copyfiles
  31.    (source (tackon source-dir "x11"))
  32.    (dest "x11:")
  33.    (all)
  34.   )
  35.  )
  36.  (makedir "x11:Help" (infos))
  37.  (copyfiles
  38.   (source (tackon source-dir "AmiWin.guide"))
  39.   (dest "x11:Help")
  40.   (infos)
  41.  )
  42.  (copyfiles
  43.   (source (tackon source-dir "REGISTRATION"))
  44.   (dest "x11:Help")
  45.   (infos)
  46.  )
  47. )
  48.  
  49. (procedure copy-ppipc
  50.  (copylib (source (tackon source-dir "x11/libs/ppipc.library"))
  51.   (dest "libs:")
  52.   (optional "force" "askuser")
  53.   (prompt "The Installer is about to install ppipc.library "
  54.   "in your LIBS: directory.")
  55.   (help "AmiWin needs ppipc.library for the local transport. "
  56.   "If you skip this step during the installation, you have to "
  57.   "install ppipc.library manually somewhere within your LIBS: "
  58.   "assign.")
  59.   (confirm)
  60.  )
  61. )
  62.  
  63. (procedure ask-config
  64.  (set keymap-name
  65.   (select
  66.    (askchoice
  67.     (prompt "Please select a keyboard driver to be "
  68.      "used by AmiWin:")
  69.     (help "AmiWin supports different keyboard drivers, "
  70.      "which correspond to Workbench keyboard drivers. Please "
  71.      "select one.")
  72.     (choices "Canadien Français" "Suisse" "Schweiz" "Deutsch"
  73.      "Dansk" "Español" "Français" "British" "Italiana" "Norsk" "Português"
  74.      "Svenskt" "American" "Dvorak")
  75.     (default 12)
  76.    )
  77.    "cdn" "ch1" "ch2" "d" "dk" "e" "f" "gb" "i" "n" "po"
  78.    "s" "usa0" "usa2"
  79.   )
  80.  )
  81.  (set usemui
  82.   (askbool
  83.    (prompt "Do you want to use the optional MUI interface ?\n\n"
  84.     "You must have at least MUI 2.2 installed for it (not "
  85.     "included in this archive)")
  86.    (help "AmiWin has an optional MUI-based graphical frontend. "
  87.     "If you want to use it you must have MUI 2.2 or higher installed.")
  88.   )
  89.  )
  90.  (set driver-name
  91.   (select
  92.    (askchoice
  93.     (prompt "Please select a display driver to be "
  94.      "used by AmiWin:")
  95.     (help "AmiWin supports different display drivers for "
  96.      "different graphics boards and chipsets. Please "
  97.      "select one.")
  98.     (choices "RTG monochrome"
  99.      "OCS/ECS/AGA monochrome"
  100.      "OCS/ECS/AGA/A2024 4-256 colors"
  101.      "Picasso 256-col (original VT software)"
  102.      "CyberGraphX 40.55 or higher")
  103.     (default 0)
  104.    )
  105.    "rtg-1" "aga-1" "aga-8" "picasso-l-8" "cybergraphx-8"
  106.   )
  107.  )
  108.  (set pstacks
  109.   (askoptions
  110.    (prompt "Please select which protocol stack(s) you "
  111.     "want to use with AmiWin:")
  112.    (help "AmiWin can be used across a TCP/IP network. "
  113.     "If you want to use this feature please select the "
  114.     "protocol stack(s) you are using.")
  115.    (choices "AmiTCP/IP 2.x or higher" "AS-225 R2")
  116.    (default 0)
  117.   )
  118.  )
  119.  (set use-amitcp (= 1 (BITAND pstacks 1)))
  120.  (set use-as225 (= 2 (BITAND pstacks 2)))
  121. )      
  122.  
  123. (procedure set-env-vars
  124.  (set env-equal-envarc (= (expandpath "ENV:") (expandpath "ENVARC:")))
  125.  (if (not (exists "ENV:AMIWIN"))
  126.   (makedir "ENV:AMIWIN")
  127.  )
  128.  (if (not env-equal-envarc)
  129.   (if (not (exists "ENVARC:AMIWIN"))
  130.    (makedir "ENVARC:AMIWIN")
  131.   )
  132.  )
  133.  (if (exists "ENV:AMIWIN/XAW") 
  134.   (delete "ENV:AMIWIN/XAW")
  135.  )
  136.  (if (not env-equal-envarc)
  137.   (if (exists "ENVARC:AMIWIN/XAW") 
  138.    (delete "ENVARC:AMIWIN/XAW")
  139.   )
  140.  )
  141.  (textfile
  142.   (dest "ENV:AMIWIN/AWOPTIONS")
  143.   (append "-fp x11:lib/x11/fonts/misc\n")
  144.   (append (cat "-keymap " keymap-name "\n"))
  145.   (append "-lalt s\n")
  146.   (append (if usemui "" "nogui\n"))
  147.   (append "-ralt s\n")
  148.   (append "-reset 0\n")
  149.   (append (cat "-xsd " driver-name "\n"))
  150.  )
  151.  (if (not env-equal-envarc)
  152.   (copyfiles
  153.    (dest "ENVARC:AMIWIN")
  154.    (source "ENV:AMIWIN/AWOPTIONS")
  155.   )
  156.  )
  157.  (textfile
  158.   (dest "ENV:AMIWIN/XTRANSPORTS")
  159.   (append (if use-amitcp "amitcp\n" ""))
  160.   (append (if use-as225 "as225\n" ""))
  161.  )
  162.  (if (not env-equal-envarc)
  163.   (copyfiles
  164.    (dest "ENVARC:AMIWIN")
  165.    (source "ENV:AMIWIN/XTRANSPORTS")
  166.   )
  167.  )
  168.  (textfile
  169.   (dest "ENV:DISPLAY")
  170.   (append "local:0\n")
  171.  )
  172.  (if (not env-equal-envarc)
  173.   (copyfiles
  174.    (dest "ENVARC:")
  175.    (source "ENV:DISPLAY")
  176.   )
  177.  )
  178.  (textfile
  179.   (dest "ENV:XAUTHORITY")
  180.   (append "X11:.Xauthority\n")
  181.  )
  182.  (if (not env-equal-envarc)
  183.   (copyfiles
  184.    (dest "ENVARC:")
  185.    (source "ENV:XAUTHORITY")
  186.   )
  187.  )
  188.  (textfile
  189.   (dest "ENV:XFILESEARCHPATH")
  190.   (append "x11:lib/x11/%T/%N\n")
  191.  )
  192.  (if (not env-equal-envarc)
  193.   (copyfiles
  194.    (dest "ENVARC:")
  195.    (source "ENV:XFILESEARCHPATH")
  196.   )
  197.  )
  198. )
  199.  
  200. (procedure add-to-startup
  201.  (set startup-addition (cat
  202.   ";BEGIN AmiWin 2.0d\n"
  203.   "assign X11: \"" (tackon @default-dest "X11") "\"\n"
  204.   "path X11:bin add\n"
  205.   ";END AmiWin 2.0d\n"
  206.   )
  207.  )
  208.  (if
  209.   (askbool
  210.    (prompt "Do you want Installer to make the required "
  211.     "changes to your s:user-startup script ?")
  212.    (help "AmiWin requires some additions to your "
  213.     "s:user-startup script. Installer will make these "
  214.     "changes for you, or you can choose to skip this "
  215.     "step and make the changes yourself.")
  216.   )
  217.   (startup @app-name
  218.    (command startup-addition)
  219.    (prompt "Installer will modify your s:user-startup "
  220.     "script. The following lines will be appended to "
  221.     "it:\n\n" startup-addition)
  222.    (help "AmiWin requires some additions to your "
  223.     "s:user-startup script, that Installer is about to make.")
  224.   )
  225.   (textfile (dest (tackon @default-dest "addition-to-user-startup"))
  226.    (append startup-addition)
  227.   )
  228.  )
  229. )
  230.  
  231. ;;;; Start
  232.  
  233. ;(welcome "Welcome to the AmiWin 2.0demo installation.\n")
  234.  
  235. (set app-name "AmiWin 2.0demo")
  236.  
  237. (check-system-version)
  238.  
  239. (complete 0)
  240.  
  241. (set source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  242.  (expandpath @icon))
  243. )
  244.  
  245. (select-destination-directory)
  246.  
  247. (if (not (exists (tackon @default-dest "x11")))
  248.  (makedir (tackon @default-dest "x11") (infos))
  249. )
  250.  
  251. (makeassign "X11" (tackon @default-dest "x11"))
  252.  
  253. (complete 10)
  254.  
  255. (copy-files-to-destination)
  256.  
  257. (complete 70)
  258.  
  259. (copy-ppipc)
  260.  
  261. (complete 80)
  262.  
  263. (ask-config)
  264.  
  265. (set-env-vars)
  266.  
  267. (complete 90)
  268.  
  269. (add-to-startup)
  270.  
  271. (complete 100)
  272.  
  273. (exit "Installation of AmiWin 2.0demo finished.\n\n"
  274.  "You should reboot your machine now. After that to "
  275.  "start AmiWin type 'startx'")
  276.